<%@ page import="com.hotel.entity.Members" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% request.setCharacterEncoding("UTF-8"); %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../js/calendar.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/hotel/style/style.css"></link>
    <style type="text/css">
        #content div {
            margin: 10px 0px;
        }

        table {
            margin: auto;
            margin-top: 20px;
            width: 700px;
            border-collapse: collapse;
        }

        th, td {
            border: solid 1px #000000;
            padding: 6px 1px;
        }

        .index {
            width: 50px;
            text-align: center;
        }

        .no {
            text-align: center;
        }

        .shortname {
            text-align: center;
        }

        .phone {
        }

        .email {
        }

        .status {
        }

        .opt {
            text-align: center;
        }

        #content div {
            text-align: center;
            margin: 0;
            padding: 0;
        }

        #content div.button {
            text-align: center;
            padding-top: 15px;
        }
        .hidden-column {
            display: none;
        }
    </style>
    <title>会员列表</title>
</head>
<body>
<div id="container">
    <div id="header">
        <ul>
            <li>
                <a href="<%=request.getContextPath()%>/hotel/manager/login.jsp"
                   onclick="return confirm('确定要退出登录吗？');">退出</a>
            </li>

        </ul>
    </div>
    <div id="menu">
        <ul>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/bookQuery.jsp">客房管理</a></li>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/memberQuery.jsp">会员管理</a></li>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/subscriptionQuery.jsp">订单管理</a></li>
        </ul>
    </div>
    <div id="content">
        <table>
            <colgroup>
                <col class="index" />
                <col class="no" />
                <col class="shortname" />
                <col class="phone" />
                <col class="email" />
                <col class="status" />
                <col class="opt" />
            </colgroup>
            <tr>
                <th>序号</th>
                <th>用户名</th>
                <th>姓名</th>
                <th>邮箱</th>
                <th>电话</th>
                <th>注册时间</th>
                <th>操作</th>
            </tr>
            <%
                List<Members> memberList = (List<Members>) request.getAttribute("memberList");
                if (memberList != null) {
                    int index = 1;
                    for (Members member : memberList) {
            %>
            <tr>
                <td><div><%= index++ %></div></td>
                <td class="hidden-column"><div><%= member.getId() %></div></td>
                <td class="hidden-column"><div><%= member.getPwd() %></div></td>
                <td><div title="密码：<%= member.getUsername() %>"><a href="#"> <%= member.getUsername() %> </a></div></td>
                <td><div><%= member.getName() %></div></td>
                <td><%= member.getEmail() %></td>
                <td><%= member.getPhone() %></td>
                <td><%= member.getRegtime() %></td>
                <td>
                    <div>
                        <a href="<%=request.getContextPath() %>/deleteSubscription3.member?id=<%= member.getId() %>" onclick="return confirm('真的要删除当前用户吗？')">删除</a>
                        <a href="<%=request.getContextPath()%>/hotel/manager/memberEdit.jsp?username=<%=member.getUsername()%>&password=<%=member.getPwd()%>&name=<%=member.getName()%>&email=<%=member.getEmail()%>&phone=<%=member.getPhone()%>">编辑信息</a>
                    </div>
                </td>
            </tr>
            <%
                    }
                }
            %>
        </table>
        <div class="button">
            <input type="button" value="重新查询" onclick="location='memberQuery.html'"/>
        </div>
    </div>
    <hr />
    <div id="footer">
        <p>本系统做为Java Web教学设计使用。未经允许，不得做为它用，版权所有Allan<br />联系方式：javamedia@live.cn</p>
    </div>
</div>
</body>
</html>
